var ReuniaoItemRender = new Class({
	"Extends":js.underas.controller.ListViewItemRender
	,"initialize":function(p_obj){						
		var htmlTmp = '<h4>'+p_obj._momento+'</h4>';
		htmlTmp += '<p class="list-group-item-text">FREQUENCIA:'+p_obj.frequencia+'</p>';
		this.parent('div',htmlTmp);
		this.getEle().addClass("col-xs-12 col-sm-12 col-md-12");
		}
	});

var Reuniao = new Class({
	"Extends":js.underas.container.ModWindow
	,"itIdReuniao":null	 
	,"itMomento":null	 
	,"itFrequencia":null	 
	,"itObs":null	 
	,"initialize":function(){
		this.parent("reunioes");
		this.setRevision("$Revision: 146 $");		
		this.setSize(4);
		this.itIdReuniao = new js.underas.controller.InputText("");
		this.itIdReuniao.setColumn("$_id");
		this.itIdReuniao.setLabel("cod.");
		this.itIdReuniao.setEnable(false);	
		this.itIdReuniao.setSize(3);	
		
		this.itMomento = new js.underas.controller.DatePicker();
		this.itMomento.setColumn("@momento");
		this.itMomento.setLabel("data");
		this.itMomento.setSize(4);	

		this.itFrequencia = new js.underas.controller.NumericStepper(0);
		this.itFrequencia.setColumn("@frequencia");
		this.itFrequencia.setLabel("frequencia");
		this.itFrequencia.setSize(5);	
	    this.itFrequencia.setMin(0);
	    this.itFrequencia.setMax(999);
	 

		this.itObs = new js.underas.controller.TextArea("");
		this.itObs.setColumn("@obs");
		this.itObs.setLabel("obs");
		this.itObs.setSize(12);	
		
		this.mainList = new js.underas.controller.ListView("Reuniao");
		this.mainList.setItemRender("ReuniaoItemRender");
		this.mainTb = new js.underas.net.ToolBar({"domain":"reuniao/reuniao"});

		this.append(this.mainTb);
		this.append(this.itIdReuniao);	
		this.append(this.itMomento);	
		this.append(this.itFrequencia);	
		this.append(this.itObs);	
		this.append(this.mainList);

		this.addAssociation({"mod":"br.net.atasacramental.discurso.view.Discursante","embed":"discursos","puid":this.getVarModule()});

	}
	,"onStart":function(){
		//this.mainTb.activate(true);
		this.mainTb.reloadItens();
	}
});
